package com.example.treinamentotiroaoalvo;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;

public class ButtonBehaviour_Shoot 
{
	public Bitmap button;
	Paint paint;
	Rect rect ;

	public ButtonBehaviour_Shoot()
	{
		paint = new Paint();
		paint.setColor(Color.BLACK);
		
		button = BitmapStorage.getInstance().getShootButtonImage();
		rect = new Rect(GameLoop.canvasWidth - (button.getWidth() + 10), GameLoop.canvasHeight - (button.getHeight() + 10), GameLoop.canvasWidth - 10, GameLoop.canvasHeight - 10);
	}
	
	public void draw(Canvas canvas)
	{
		canvas.drawBitmap(button, null, rect, paint);
	}
	
	public boolean Detect(int x, int y)
	{
		if(rect.contains(x, y))
		{
			return true;
		}
		return false;
	}
}
